web3.js web3.utils.utf8ToHex
web3.utils.utf8ToHex(string)
web3.utils.stringToHex(string) // ALIAS
web3.utils.fromUtf8(string) // ALIAS, deprecated
渡された UTF-8 文字列に対応する16進数表現の文字列を返します。
パラメータ
1. String - String
戻り値
String
サンプル
code:example.js
web3.utils.utf8ToHex('I have 100€');
"0x49206861766520313030e282ac"
参考
https://web3js.readthedocs.io/en/1.0/web3-utils.html#utf8tohex
#web3.js #web3.js@1.0
web3.js 日本語 API リファレンス